package cn.tedu.bzy.mapper;


import cn.tedu.bzy.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface UserMapper {
    @Select("select * from user where uid=#{uid}")
    @Result(column = "pic_url",property = "picUrl")
    @Result(column = "reg_time",property = "regTime")
    @Result(column = "last_time",property = "lastTime")
    @Result(column = "transfer_times",property = "transferTimes")
    @Result(column = "transferred_times",property = "transferredTimes")
    @Result(column = "up_times",property = "upTimes")
    @Result(column = "down_times",property = "downTimes")
    User selectAllById(int uid);

    @Update("update user set nick=#{nick},mail=#{mail},birthday=#{birthday},phone=#{phone},pic_url=#{picUrl} where uid=#{uid}" )
    void updateById(User user);
}
